package com.agile4j.oss.adapter;

/**
 * Result类的简单实现（用于兼容MinIO的API）
 * 在实际项目中，可能需要更完整的实现
 * @author cthd
 * {@code @date}  2025/9/17 14:37
 * @version 1.0
 * Description: Result.class
 */
public class Result<T> {
    private T value;
    private Exception exception;

    public Result(T value) {
        this.value = value;
    }

    public Result(Exception exception) {
        this.exception = exception;
    }

    public Result() {
    }

    public T get() throws Exception {
        if (exception != null) {
            throw exception;
        }
        return value;
    }

    public Exception error() {
        return exception;
    }
}